<script setup>
import MeanItem from './MeanItem.vue'
import {defineProps} from 'vue'

const props = defineProps({
  route: {
    type: Object,
    required: true
  }
})
console.log(props.route)
</script>

<template>
  <div>
    <el-sub-menu v-if="route.children" :index="route.path">
      <template #title>
        <MeanItem :icon="route.icon" :title="route.title"></MeanItem>
      </template>
      <SideBarItem v-for="(item, index) in route.children" :key="index" :route="item"></SideBarItem>
    </el-sub-menu>
    <el-menu-item v-else :index="route.path">
      <MeanItem :icon="route.icon" :title="route.title"></MeanItem>
    </el-menu-item>
  </div>
</template>

<style scoped>

</style>